CREATE TABLE `dwd_waybill_customer_complaint_detail_new_dt`
(
    `data_time`              date NULL COMMENT "数据时间",
    `work_type`              varchar(200) NULL COMMENT "工单类型",
    `accept_time`            varchar(200) NULL COMMENT "受理时间",
    `waybill_no`             varchar(200) NULL COMMENT "运单号",
    `first_type_code`        varchar(200) NULL COMMENT "一级问题类型编码",
    `first_type_name`        varchar(2048) NULL COMMENT "一级问题类型名称",
    `second_type_code`       varchar(200) NULL COMMENT "二级问题类型编码",
    `second_type_name`       varchar(2048) NULL COMMENT "二级问题类型名称",
    `create_time`            varchar(200) NULL COMMENT "创建时间",
    `trans_offices`          varchar(200) NULL COMMENT "转办局",
    `deliver_type`           varchar(200) NULL COMMENT "投递类型",
    `accept_network_code`    varchar(200) NULL COMMENT "受理网点编码",
    `accept_network_name`    varchar(200) NULL COMMENT "受理网点名称",
    `accept_network_type`    bigint(20) NULL COMMENT "网点标识,1网点,2转运中心,3集散点,4其它",
    `accept_proxy_code`      varchar(200) NULL COMMENT "受理网点所属代理区编码",
    `accept_proxy_name`      varchar(200) NULL COMMENT "受理网点所属代理区名称",
    `transfer_network_code`  varchar(200) NULL COMMENT "转单责任网点编码",
    `transfer_network_name`  varchar(200) NULL COMMENT "转单责任网点名称",
    `transfer_network_types` bigint(20) NULL COMMENT "转单责任网点类型id",
    `transfer_network_type`  bigint(20) NULL COMMENT "转单责任网点类型",
    `duty_network_code`      varchar(200) NULL COMMENT "责任网点编码",
    `duty_network_name`      varchar(200) NULL COMMENT "责任网点名称",
    `duty_network_type`      bigint(20) NULL COMMENT "责任网点类型ID",
    `duty_proxy_code`        varchar(200) NULL COMMENT "责任网点所属代理区编码",
    `duty_proxy_name`        varchar(200) NULL COMMENT "责任网点所属代理区名称",
    `work_order_reason_step` varchar(200) NULL COMMENT "引发诉问题的环节",
    `is_delete`              bigint(20) NULL COMMENT "是否已删除 1:已删除，2：未删除，0：不存在",
    `work_order_no`          varchar(64) NULL COMMENT "工单编号",
    `delivery_code`          varchar(64) NULL COMMENT "派件员编码",
    `delivery_name`          varchar(64) NULL COMMENT "派件员名称",
    `tail_code`              varchar(64) NULL COMMENT "区域编码",
    `tail_name`              varchar(64) NULL COMMENT "区域名称",
    `problem_desc`           varchar(2048) NULL COMMENT "问题描述",
    `work_order_channel`     int(11) NULL COMMENT "渠道来源(1.PDD，2.紫金山)",
    `express_cabinet`        varchar(64) NULL COMMENT "快递柜",
    `incoming_time`          datetime NULL COMMENT "入库时间",
    `trans_time`             datetime NULL COMMENT "转办时间",
    `his_delete`             tinyint(4) NULL COMMENT "是否历史剔除",
    `work_order_source_id`   varchar(100) NULL COMMENT "工单创建来源 0：平台 1：消费者 2：商家",
    `remarks`                varchar(100) NULL COMMENT "投诉内容“未收到货”或反馈没收到货",
    `create_day`             varchar(100) NULL COMMENT "日期-创建时间截取年月日",
    `order_source_code`      varchar(100) NULL COMMENT "工单来源编码",
    `order_source_name`      varchar(100) NULL COMMENT "工单来源名称",
    `duty_type`              varchar(100) NULL COMMENT "责任类型",
    `provider_id`            varchar(100) NULL COMMENT "责任网点所属省份id",
    `provider_desc`          varchar(100) NULL COMMENT "责任网点所属省份名称",
    `city_id`                varchar(100) NULL COMMENT "责任网点所属城市id",
    `city_desc`              varchar(100) NULL COMMENT "责任网点所属城市name",
    `district_code`          varchar(100) NULL COMMENT "片区code",
    `district_desc`          varchar(100) NULL COMMENT "片区name",
    `district_id`            varchar(100) NULL COMMENT "片区id",
    `transfer_proxy_code`    varchar(100) NULL COMMENT "转单责任网点对应代理区code",
    `transfer_proxy_name`    varchar(100) NULL COMMENT "转单责任网点对应代理区name",
    `transfer_provider_id`   varchar(100) NULL COMMENT "转单责任网点对应省id",
    `transfer_provider_desc` varchar(100) NULL COMMENT "转单责任网点对应省name",
    `transfer_city_id`       varchar(100) NULL COMMENT "转单责任网点对应市id",
    `transfer_city_desc`     varchar(100) NULL COMMENT "转单责任网点对应市name",
    `transfer_district_code` varchar(100) NULL COMMENT "转单责任网点片区code",
    `transfer_district_desc` varchar(100) NULL COMMENT "转单责任网点片区desc",
    `transfer_district_id`   varchar(100) NULL COMMENT "转单责任网点片区id",
    `record_group`           varchar(100) NULL COMMENT "录单组别 1:电话组 2:在线组",
    `send_back_code`         varchar(100) NULL COMMENT "客诉退回标识:1是2否",
    `reback_transfer_falg`   varchar(100) NULL COMMENT "退转件中是否退回:1是0否"
) ENGINE=OLAP
DUPLICATE KEY(`data_time`, `work_type`, `accept_time`)
COMMENT "客诉量明细"
PARTITION BY RANGE(`data_time`)
DISTRIBUTED BY HASH(`waybill_no`) BUCKETS 5
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "2",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "5",
"in_memory" = "false",
"storage_format" = "V2"
);

CREATE TABLE `dwd_waybill_customer_complaint_detail_dt`
(
    `data_time`              date NULL COMMENT "数据时间",
    `work_type`              varchar(200) NULL COMMENT "工单类型",
    `accept_time`            varchar(200) NULL COMMENT "受理时间",
    `waybill_no`             varchar(200) NULL COMMENT "运单号",
    `first_type_code`        varchar(200) NULL COMMENT "一级问题类型编码",
    `first_type_name`        varchar(2048) NULL COMMENT "一级问题类型名称",
    `second_type_code`       varchar(200) NULL COMMENT "二级问题类型编码",
    `second_type_name`       varchar(2048) NULL COMMENT "二级问题类型名称",
    `create_time`            varchar(200) NULL COMMENT "创建时间",
    `trans_offices`          varchar(200) NULL COMMENT "转办局",
    `deliver_type`           varchar(200) NULL COMMENT "投递类型",
    `accept_network_code`    varchar(200) NULL COMMENT "受理网点编码",
    `accept_network_name`    varchar(200) NULL COMMENT "受理网点名称",
    `accept_network_type`    bigint(20) NULL COMMENT "网点标识,1网点,2转运中心,3集散点,4其它",
    `accept_proxy_code`      varchar(200) NULL COMMENT "受理网点所属代理区编码",
    `accept_proxy_name`      varchar(200) NULL COMMENT "受理网点所属代理区名称",
    `transfer_network_code`  varchar(200) NULL COMMENT "转单责任网点编码",
    `transfer_network_name`  varchar(200) NULL COMMENT "转单责任网点名称",
    `transfer_network_types` bigint(20) NULL COMMENT "转单责任网点类型",
    `transfer_network_type`  bigint(20) NULL COMMENT "转单责任网点类型",
    `duty_network_code`      varchar(200) NULL COMMENT "责任网点编码",
    `duty_network_name`      varchar(200) NULL COMMENT "责任网点名称",
    `duty_network_type`      bigint(20) NULL COMMENT "责任网点类型ID",
    `duty_proxy_code`        varchar(200) NULL COMMENT "责任网点所属代理区编码",
    `duty_proxy_name`        varchar(200) NULL COMMENT "责任网点所属代理区名称",
    `work_order_reason_step` varchar(200) NULL COMMENT "引发诉问题的环节",
    `is_delete`              bigint(20) NULL COMMENT "是否已删除 1:已删除，2：未删除，0：不存在",
    `work_order_no`          varchar(64) NULL COMMENT "工单编号",
    `delivery_code`          varchar(64) NULL COMMENT "派件员编码",
    `delivery_name`          varchar(64) NULL COMMENT "派件员名称",
    `tail_code`              varchar(64) NULL COMMENT "区域编码",
    `tail_name`              varchar(64) NULL COMMENT "区域名称",
    `problem_desc`           varchar(2048) NULL COMMENT "问题描述",
    `work_order_channel`     int(11) NULL COMMENT "渠道来源(1.PDD，2.紫金山)",
    `express_cabinet`        varchar(64) NULL COMMENT "快递柜",
    `incoming_time`          datetime NULL COMMENT "入库时间",
    `trans_time`             datetime NULL COMMENT "转办时间",
    `his_delete`             tinyint(4) NULL COMMENT "是否历史剔除",
    `work_order_source_id`   varchar(100) NULL COMMENT "工单创建来源 0：平台 1：消费者 2：商家",
    `remarks`                varchar(100) NULL COMMENT "投诉内容“未收到货”或反馈没收到货",
    `create_day`             varchar(100) NULL COMMENT "日期-创建时间截取年月日",
    `order_source_code`      varchar(100) NULL COMMENT "工单来源编码",
    `order_source_name`      varchar(100) NULL COMMENT "工单来源名称",
    `duty_type`              varchar(100) NULL COMMENT "责任类型",
    `provider_id`            varchar(100) NULL COMMENT "责任网点所属省份id",
    `provider_desc`          varchar(100) NULL COMMENT "责任网点所属省份名称",
    `city_id`                varchar(100) NULL COMMENT "责任网点所属城市id",
    `city_desc`              varchar(100) NULL COMMENT "责任网点所属城市name",
    `district_code`          varchar(100) NULL COMMENT "片区code",
    `district_desc`          varchar(100) NULL COMMENT "片区name",
    `district_id`            varchar(100) NULL COMMENT "片区id",
    `transfer_proxy_code`    varchar(100) NULL COMMENT "转单责任网点对应代理区code",
    `transfer_proxy_name`    varchar(100) NULL COMMENT "转单责任网点对应代理区name",
    `transfer_provider_id`   varchar(100) NULL COMMENT "转单责任网点对应省id",
    `transfer_provider_desc` varchar(100) NULL COMMENT "转单责任网点对应省name",
    `transfer_city_id`       varchar(100) NULL COMMENT "转单责任网点对应市id",
    `transfer_city_desc`     varchar(100) NULL COMMENT "转单责任网点对应市name",
    `transfer_district_code` varchar(100) NULL COMMENT "转单责任网点片区code",
    `transfer_district_desc` varchar(100) NULL COMMENT "转单责任网点片区desc",
    `transfer_district_id`   varchar(100) NULL COMMENT "转单责任网点片区id",
    `record_group`           varchar(100) NULL COMMENT "录单组别 1:电话组 2:在线组",
    `send_back_code`         varchar(100) NULL COMMENT "客诉退回标识:1是2否",
    `reback_transfer_falg`   varchar(100) NULL COMMENT "退转件中是否退回:1是0否"
) ENGINE=OLAP
DUPLICATE KEY(`data_time`, `work_type`, `accept_time`)
COMMENT "客诉量明细"
PARTITION BY RANGE(`data_time`)
DISTRIBUTED BY HASH(`waybill_no`) BUCKETS 5
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "2",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "5",
"in_memory" = "false",
"storage_format" = "V2"
);